var commonLoading='Loading...';var urlMedias='http://medias.whatsthescore.com';(function(){if(typeof jQuery=='undefined'){var script=document.createElement("SCRIPT");script.src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js';script.type='text/javascript';document.getElementsByTagName("head")[0].appendChild(script);}
if(typeof jstz=='undefined'){var script=document.createElement("SCRIPT");script.src='http://cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.4/jstz.min.js';script.type='text/javascript';document.getElementsByTagName("head")[0].appendChild(script);}
var checkReady=function(callback){if(window.jQuery&&window.jstz){callback(jQuery);}
else{window.setTimeout(function(){checkReady(callback);},100);}};checkReady(function($){jQuery(document).ready(function($){loadWidget();});});function loadWidget(){if(typeof jQuery.receiveMessage=='undefined'){
/*!
             * jQuery postMessage - v0.5 - 9/11/2009
             * http://benalman.com/projects/jquery-postmessage-plugin/
             *
             * Copyright (c) 2009 "Cowboy" Ben Alman
             * Dual licensed under the MIT and GPL licenses.
             * http://benalman.com/about/license/
             */
(function($){'$:nomunge';var interval_id,last_hash,cache_bust=1,rm_callback,window=this,FALSE=!1,postMessage='postMessage',addEventListener='addEventListener',p_receiveMessage,has_postMessage=window[postMessage];if(has_postMessage&&typeof $.browser!='undefined'){has_postMessage=!$.browser.opera;}
$[postMessage]=function(message,target_url,target){if(!target_url){return;}
message=typeof message==='string'?message:$.param(message);target=target||parent;if(has_postMessage){target[postMessage](message,target_url.replace(/([^:]+:\/\/[^\/]+).*/,'$1'));}else if(target_url){target.location=target_url.replace(/#.*$/,'')+'#'+(+new Date)+(cache_bust++)+'&'+message;}};$.receiveMessage=p_receiveMessage=function(callback,source_origin,delay){if(has_postMessage){if(callback){rm_callback&&p_receiveMessage();rm_callback=function(e){if((typeof source_origin==='string'&&e.origin!==source_origin)||($.isFunction(source_origin)&&source_origin(e.origin)===FALSE)){return FALSE;}
callback(e);};}
if(window[addEventListener]){window[callback?addEventListener:'removeEventListener']('message',rm_callback,FALSE);}else{window[callback?'attachEvent':'detachEvent']('onmessage',rm_callback);}}else{interval_id&&clearInterval(interval_id);interval_id=null;if(callback){delay=typeof source_origin==='number'?source_origin:typeof delay==='number'?delay:100;interval_id=setInterval(function(){var hash=document.location.hash,re=/^#?\d+&/;if(hash!==last_hash&&re.test(hash)){last_hash=hash;callback({data:hash.replace(re,'')});}},delay);}}};})(jQuery);}
var scripts=document.getElementsByTagName("script");var tools_url=null;var regex_pattern=/\/load(\.min)?\.js/;for(i in scripts){var a=document.createElement('a');a.href=scripts[i].src;if(regex_pattern.test(a.href)){tools_url="//"+a.hostname+"/tools.php?";}}
if(tools_url!=null){jQuery.receiveMessage(function(e){var uri=e.data;var queryString={};uri.replace(new RegExp("([^?=&]+)(=([^&#]*))?","g"),function($0,$1,$2,$3){queryString[$1]=$3;});var h=Number(queryString['if_height']);var iframe=queryString['iframe'];var if_height=jQuery('#'+iframe).height();if(!isNaN(h)&&h>0&&h!==if_height){jQuery('#'+iframe).attr('height',h+'px');}});jQuery('div.tap-sport-tools').each(function(){var tools_width=jQuery(this).css('width');var tools_id=jQuery(this).attr('data-id');var iframe_id='tap-sport-tools-'+tools_id;var currentLocation=location.href;var hashIndex=currentLocation.indexOf('#');if(hashIndex>-1){currentLocation=currentLocation.substring(0,hashIndex);}
var timezone=jstz.determine();var iframe_url=tools_url+'id='+tools_id+'&iframe='+iframe_id+'&tz-js='+timezone.name();if(typeof jQuery(this).attr("data-type")!="undefined"){iframe_url+="&type="+jQuery(this).attr("data-type");}
iframe_url+='#'+encodeURIComponent(document.location.href);var idHtml='container-tap-sport-tools-'+tools_id;var html='<div class="container-tap-sport-tools" id="'+idHtml+'">'
+'<div class="tap_sport_tools-frame-loading">'
+'<h3>'
+commonLoading
+'</h3>'
+'</div>'
+'<style>'
+'.container-tap-sport-tools {'
+'overflow: hidden;'
+'position: relative;'
+'clear: left;'
+'}'
+'#'+idHtml+' {'
+'width: '+tools_width+';'
+'}'
+'.tap_sport_tools-frame-loading {'
+'background: #fff url('+urlMedias+'/images/wd-container-loading.gif) center 75px no-repeat;'
+'height: 200px;'
+'width: '+tools_width+';'
+'}'
+'.tap_sport_tools-frame-loading h3 {'
+'margin: 20px auto;'
+'width: 600px;'
+'text-align: center;'
+'}'
+'.tap_sport_tools-frame-loading {'
+'left; 0px;'
+'top: 0px;'
+'position: absolute;'
+'z-index: 1000;'
+'}'
+'</style>'
+'<iframe id="'+iframe_id+'" class="tap-sport-tools" '
+' width="'+tools_width+'" src="'+iframe_url+'" '
+' frameborder="0" scrolling="no" style="vertical-align: bottom;"></iframe>'
+'</div>';jQuery(this).replaceWith(html);jQuery('#'+iframe_id).load(function(){jQuery('.tap_sport_tools-frame-loading').css('display','none');});});}}})();